package com.iweb.entity;

/**
 * 宠物类 父类
 */
public abstract class Pet {
    /*昵称*/
    protected String nickName;
    /*健康值*/
    protected int health;
    /*亲密度*/
    protected int love;
    /*等级*/
    protected int level;

    /**
     * 显示宠物信息
     */
    public void show(){
        System.out.println("昵称:"+nickName);
        System.out.println("健康值:"+health);
        System.out.println("亲密度:"+love);
        System.out.println("等级:"+level);
    }

    /**
     * 宠物玩游戏 抽象方法 被子类重写
     * @return 宠物能否玩游戏 true代表可以玩游戏 false代表疲倦了，不能玩了
     */
    public abstract boolean play();

    /**
     * 喂食宠物 抽象方法 被子类重写
     * @return 宠物能否喂食 true代表能喂食 false代表吃饱了，不能喂食
     */
    public abstract boolean eat();

    public Pet(){}

    public Pet(String nickName, int health, int love, int level) {
        this.nickName = nickName;
        this.health = health;
        this.love = love;
        this.level = level;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public int getHealth() {
        return health;
    }

    public void setHealth(int health) {
        this.health = health;
    }

    public int getLove() {
        return love;
    }

    public void setLove(int love) {
        this.love = love;
    }

    public int getLevel() {
        return level;
    }

    public void setLevel(int level) {
        this.level = level;
    }
}

